package com.yaowk.system.plugin;

import com.jfinal.aop.Enhancer;
import com.jfinal.plugin.IPlugin;
import com.yaowk.system.model.Platform;
import com.yaowk.system.service.ModuleService;

import java.util.List;

/**
 * 模块数据初始化插件
 *
 * @authc yaowk
 * 2017/4/19
 */
public class SystemInitPlugin implements IPlugin {
    @Override
    public boolean start() {
        List<Platform> platformList = Platform.dao.findPlatform();
        ModuleService service = Enhancer.enhance(ModuleService.class);
        service.initModuleByPlatformList(platformList);
        return true;
    }

    @Override
    public boolean stop() {
        return false;
    }
}
